home *** CD-ROM | disk | FTP | other *** search
- /*
- *--- PGetPrivateData.cpp -------------------------------------------------
- * Copyright (c) 1995-96 Adobe Systems Incorporated. All rights reserved.
- * Created on Thu, Oct 12, 1995 @ 10:43 PM by Paul Ferguson.
- *
- * Description: For notes about this class, refer to the
- * PCL documentation file PGetPrivateData.html
- *-------------------------------------------------------------------------
- */
- #include <string.h>
- #ifdef MACINTOSH
- #include <exception.h>
- #endif MACINTOSH
-
- #include "PMCQErrs.h"
- #include "PGetPrivateData.h"
- #include "PQuery.h"
- #include "PRequestBuf.h"
- #include "PReplyBuf.h"
-
- PGetPrivateData::PGetPrivateData
- ( const char * sDeveloperID,
- const char * sPluginID,
- short cTargetClass,
- unsigned long nTypeFlag,
- unsigned long nTargetID )
-
- : PHandleQuery()
-
- {
- if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
- throw CQ_INVALID_CQ_ARG;
-
- PRequestBuf request(100); // plenty big to hold everything.
- request << sDeveloperID
- << sPluginID
- << cTargetClass
- << nTypeFlag
- << nTargetID;
-
- // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
- // If the object has no private data, an exception
- // (CQ_NOPDATA) will be thrown. If you don't want
- // your plug-in to fail, you must handle the exception.
- PQuery query(pm_getprivatedata, request, itsHandle);
- InitHandle();
-
- PReplyBuf reply(replyPtr);
-
- long temp;
- reply >> nSize >> cPlatform >> temp;
- hPrivateData = (PMHandle) temp;
- }
-
- // end of PGetPrivateData.cpp
-